<style>
.fui-goods-item .image {
    height: 7rem;
    width: 10rem;
}
.fui-goods-group {
    padding:0.3rem
}
.timer {
    font-size: .6rem;
    height: .95rem;
    color: #ef4f4f;
}
.timer span {
    display: inline-block;
    background:#582e19;
    color:#fff;
    width:.9rem;height:.9rem;
    border-radius: .1rem;
    line-height:.9rem;
    font-size:.5rem; text-align: center;
}

</style>
	<div ng-if="!loading && pagedata.list.length>0" class="fui-goods-group no" style="background-color:#f7f7f7">
			<div ng-repeat="item in pagedata.list" class="fui-goods-item" style="padding:0;margin:0.3rem;border: 0px solid #e7e7e7;">
				<div ng-click="pagedata.gotoitem(item);" ng-if="!item.video || pagedata.shopset.no_video==1" ng-class="{'image':1, 'echelon':item.active.title}" data-text="{{item.active.title}}" style="background-image: url({{tomedia(item.image) ||'../core/resource/images/nopic.jpg'}})">
						<div ng-show="item.total <=0" class="salez" style="background-image: url({{tomedia(pagedata.shopset.shop.saleout)}}); "></div>
				</div>
				<div ng-if="item.video && pagedata.shopset.no_video !=1" class="image">
					<video style="width:100%;height:100%;background:#999" controls="" x5-playsinline="" playsinline="" webkit-playsinline="" preload="auto"
						  poster="{{tomedia(item.image) || '../core/resource/images/nopic.jpg'}}"
						  data-setup='{"controls": true, "autoplay": false}'>
						  <source ng-src="{{tomedia(item.video)}}" type="video/mp4">					 
					</video>
				</div>
				<div class="detail" style="height:2.6rem;padding-left:0.3rem;padding-top:0.2rem">
					<div ng-click="pagedata.gotoitem(item);" class="overflow-h" style="width:10rem">
							{{item.title}}
					</div>
					<div ng-if="!item.active.rest_time" class="subtitle overflow-h" style="width:10rem">
							{{item.subtitle || '暂时没有商品描述... ...'}}
					</div>
					<div ng-if="item.active.rest_time" class="timer" ng-init="tool.time_down(pagedata.list[$index].active.rest_time)" style="width:10rem">
							{{item.active.status==0?'距开始':'距结束'}}  <span class="time-hour">{{pagedata.list[$index].active.rest_time.hour}}</span>:<span class="time-min">{{pagedata.list[$index].active.rest_time.minute}}</span>:<span class="time-sec">{{pagedata.list[$index].active.rest_time.second}}</span>
					</div>
					<div>
					<div ng-if="item.commission_money || pagedata.feemoney.isopen==1" class="goods-tag">
						<div ng-if="pagedata.feemoney.isopen==1" class="fui-tag fui-tag-danger fee-tag-zi" style="margin-right:0.15rem">{{pagedata.feemoney.tag ||'节省'}}￥{{item.feemoney || '0.00'}}</div>
						<div ng-if="item.commission_money" class="fui-tag fui-tag-danger fee-tag">{{item.commission_title}}￥{{item.commission_money}}</div>
					</div>
						<div ng-if="!item.commission_money && !pagedata.feemoney.isopen && pagedata.nomore_merch!=1" class="fui-tag fui-tag-danger" style="background:linear-gradient(to right,rgba(244,221,187,0.6),rgba(235,216,174,1));color:#512f0a;width:auto;font-weight:400">{{item.merchname || '平台直营'}}</div>
						<div ng-if="!item.commission_money && !pagedata.feemoney.isopen && pagedata.nomore_merch==1" class="subtitle red" style="line-height:1">关注人数：{{item.likes}}</div>
						<span class="price green" style="margin-top:0.1rem">￥ 
							<span ng-if="!item.active.price" style="font-weight:bold;font-size:0.8rem;">{{item.price}}</span>
							<span ng-if="item.active.price" style="font-weight:bold;font-size:0.8rem;">{{item.active.price}}</span> /{{item.unit || '份'}}
							<span ng-if="!pagedata.pluginset.noweight && item.weight>0" style="color:#999;font-size:0.55rem;font-weight:400">({{item.weight}}kg)</span>
						</span>
					</div>
					<div style="position: absolute;bottom:1.1rem;width:100%">
						<div href="javascript:" ng-click="pagedata.addtocart(item)" class="jylabel jylabel-red active" style="padding:0.25rem 0.5rem;border-radius:1rem;font-weight:400">加入购物车</div>
					</div>
					<div class="price" style="position:absolute;margin-top: 0.5rem;bottom:0.1rem;width:10rem">
						<span class="text" style="padding-top:0.5rem;"><span class="subtitle" style="font-weight:400;padding-left:0.2rem;font-size:0.6rem">已售{{item.salenum || 0}}{{item.unit || '件'}}</span></span>
						<span class=" fui-buys-info r-f" style="width:6rem;padding-right:0.6rem">
								<img ng-repeat="m in item.members" ng-if="$index<6" class="avatar r-f" style="width:1.3rem;height:1.3rem;margin-right:-0.6rem" ng-src="{{tomedia(m.avatar) || '../core/resource/images/nopic.jpg'}}">
						</span>
					</div>
				</div>
			</div>
	</div>
	<div ng-show="loading" class='infinite-loading'><span class='fui-preloader'></span><span style="margin-left:1.5rem"> 正在加载...</span></div>
	<div id="showtaobaoke"  class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
			<div class="modal-dialog" style="width:80%;left:10%;">
				<div class="wap-qrcode-container" style="border-radius:0.5rem;height:auto">
					<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
					<p class="example1" style="padding:0.3rem;border-radius:0.5rem;margin:1rem;background:#FFFFCC">{{pagedata.copyinfo}}</p>
					<p ng-click="clip(pagedata.copyinfo)" class="example1 btn btn-sm btn-red-o">复制商品口令</p>
				</div>
			</div>
	</div>
<script>
scope.pagedata.gotoitem=function(item){
	if(item.pluginname=='jy_taobaoke'){
		$('#showtaobaoke').modal();
		scope.pagedata.selectgoods=item;
		scope.pagedata.copyinfo='【'+item.title+'】'+item.active.url+' 点击链接，再选择浏览器打开；或复制这段描述'+item.active.code+'后到《手机淘宝》';
		scope.$evalAsync();
	}else{
		scope.access_json(item.active.url || 'jy_weishop/goods.detail//id='+item.id);
	}
}
scope.pagedata.addtocart=function(item){
	scope.post_json('jy_weishop/goods.detail/addtocart/',{'goodsid':item.id},function(){
		if(scope.main.menus && scope.main.menus.length>0){
			for(var i=0;i<scope.main.menus.length;i++){
				if(scope.main.menus[i].action=='jy_weishop/member.cart/'){
					scope.main.menus[i].nums++
				}
			}
		}
		scope.message('加入成功！');
		scope.$evalAsync();
	})
}
scope.pagedata.params=scope.pagedata.params?scope.pagedata.params:{};
var pcate=scope.pagedata.params.pid?scope.pagedata.params.pid:'';
var order=scope.pagedata.params.order?scope.pagedata.params.order:'ishot';
scope.tool.get_list('jy_weishop/goods.index/getlist/order='+order+'&pcate='+pcate,true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_weishop/goods.index/getlist/');
}
</script>
